<?php

/**
 * ClickDetails form base class.
 *
 * @method ClickDetails getObject() Returns the current form's model object
 *
 * @package    ecrm
 * @subpackage form
 * @author     Saul Santiago
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseClickDetailsForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'                                 => new sfWidgetFormInputHidden(),
      'email_campaign_user_performance_id' => new sfWidgetFormInputText(),
      'link_name'                          => new sfWidgetFormInputText(),
      'link_url'                           => new sfWidgetFormInputText(),
      'click_date'                         => new sfWidgetFormDate(),
      'created_at'                         => new sfWidgetFormDateTime(),
      'updated_at'                         => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'                                 => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
      'email_campaign_user_performance_id' => new sfValidatorInteger(array('required' => false)),
      'link_name'                          => new sfValidatorString(array('max_length' => 100, 'required' => false)),
      'link_url'                           => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'click_date'                         => new sfValidatorDate(array('required' => false)),
      'created_at'                         => new sfValidatorDateTime(),
      'updated_at'                         => new sfValidatorDateTime(),
    ));

    $this->widgetSchema->setNameFormat('click_details[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'ClickDetails';
  }

}
